package com.systemsjr.jrenterprise.invoice;

import com.systemsjr.jrenterprise.invoice.vo.InvoiceSearchCriteria;
import com.systemsjr.jrenterprise.utils.ServiceUtils;
import com.systemsjr.jrlib.richclient.BaseItemFilterForm;
import com.systemsjr.jrlib.richclient.table.JRTableUtils;

public class InvoiceFilterForm extends BaseItemFilterForm<InvoiceSearchCriteria> {

	public InvoiceFilterForm() {
		super("invoiceFilterForm");
	}

	@Override
	protected void doSearch() {
		commit();
		InvoiceSearchCriteria criteria = (InvoiceSearchCriteria) getFormObject();
		JRTableUtils.refreshTable(table, ServiceUtils.getInvoiceService().search(criteria));
		
	}

	@Override
	protected void doCreateFormControl() {
		
		builder.row();
		builder.add("id");
		builder.row();
		builder.add("invoiceDate");
		builder.row();
		
	}
	
	@Override
	protected Object newFormObject() {
		InvoiceSearchCriteria criteria = new InvoiceSearchCriteria();
		
		return criteria;
	}

}
